package com.xmy.cultivate.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xmy.cultivate.entity.RecruitAuditLog;
import com.xmy.cultivate.mapper.RecruitAuditLogMapper;
import com.xmy.cultivate.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.context.annotation.Lazy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 审核记录 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2024-11-27
 */
@Service
public class RecruitAuditLogServiceImpl extends ServiceImpl<RecruitAuditLogMapper, RecruitAuditLog> implements IRecruitAuditLogService {

    @Autowired
    @Lazy
    IRecruitAuditLogService iRecruitAuditLogService;

    @Override
    public RecruitAuditLog selectRecruitAuditLog(Integer status,Long recruitId,Integer type) {
        QueryWrapper<RecruitAuditLog> recruitAuditLogQueryWrapper = new QueryWrapper<>();
        recruitAuditLogQueryWrapper.eq("recruit_id",recruitId);
        recruitAuditLogQueryWrapper.eq("status", status);
        recruitAuditLogQueryWrapper.eq("type", type);
        recruitAuditLogQueryWrapper.last("limit 1");
        //查询返回实体类
        RecruitAuditLog recruitAuditLog = iRecruitAuditLogService.getOne(recruitAuditLogQueryWrapper);
        return recruitAuditLog;
    }
}
